package bullets;

import core.FlyingObject;
import core.World;

public abstract class Bullet extends FlyingObject{
	/**
	 * 
	 */
	private static final long serialVersionUID = 2965376878925166944L;

	public Bullet() {
	};
	
	// protected int speed;//
	// 子弹的xy由英雄或者敌机的xy决定，所以构造时需要外界传参数
	public Bullet(int width, int high, int x, int y) {
		super(x, y, width, high);
	}
	public void step2(int x,int y) {//大招出现时的移动方式
		if(x<this.x) {
			this.x-=speed;
		}else {
			this.x+=speed;
		}
		if(y<this.y) {
			this.y-=speed;
		}else {
			this.y+=speed;
		}
	}

	// 重写父类FlyingObject的越界方法
	public boolean outOfBounds() {
		if (this.y <= 0 || this.y >= World.WORLD_HEIGHT) {
			return true;
		} else {
			return false;
		}
	}

	public void goDead() {// 去死
		status = remove;
		System.out.println("sss");
	}

}
